# coding=utf-8
"""c21_qrcode URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
# from django.conf.urls import include, url
from django.conf.urls import url, include
# from django.contrib import admin
from c21_qrcode import views
from ink_qrcode import views as ink_views

urlpatterns = [
    # 修改此处记得修改view的正则,和各个环境的配置文件
    # 分配:(以appid区分调用项目, 看配置文件)
    #   r: 二维码, 短链二级域名/3g/(由于起初没有这样(以appid区分调用项目)做,顾兼顾之前的home二维码)
    #   p: 公共项目, 短链二级域名/p/
    #   ink: ink推广, 短链二级域名/p/
    url(r'^(r|p|s|g|o)/(?P<short_url>[_a-zA-Z0-9-]{4,9})',
        views.UrlRender.as_view()),
    url(r'^qr/(?P<short_url>[_a-zA-Z0-9-]{4,9})',
        ink_views.UrlRender.as_view()),
    url(r'^qrcode/$', views.QRcode.as_view()),
    url(r'^longurl/$', views.LongUrl.as_view()),
    url(r'^shorturl/create$', views.ShortUrl.as_view()),
    url(r'hold/', include("ink_qrcode.urls", namespace='hold_qrcode')),
]
